<%--
    Document   : temp
    Created on : Oct 4, 2012, 4:10:02 PM
    Author     : MinhThang
--%>

<%@page import="org.apt.connectDB.MyConnect"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>National Level Paper Presentation</title>
        <link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
        <link href="../style/style.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="style/js/jquery.js"></script>
<script type="text/javascript" src="style/js/jNice.js"></script>
    </head>
    <body>

        <div id="wrapper">
            <h1><a href="#"><span>Admin Paper Presentation</span></a></h1>
            <div><%@include file="Template/header.jsp" %></div>
            <div id="containerHolder">
                      <div id="sidebar">
                	<ul class="sideNav">
                            <li class="limenu"><a href="list_payment_lecture.jsp"  class="active">Payment lecture event</a></li>
                            <li class="limenu"><a href="list_payment_seminar.jsp">Payment seminar</a></li>
                            <li class="limenu"><a href="list_lecture_active.jsp">Paided payment lecture</a></li>
                            <li class="limenu"><a href="list_Seminar_active.jsp">Paided payment lecture</a></li>
                        </ul>
                    <!-- // .sideNav -->
                        </div>
                    <h2><a href="#">Lecture >></a> <a href="#" class="active">Payment detail</a></h2>
                <div id="main">
                    <form action="activepaymentlecture.do" class="jNice">
                        <%
                           if(session.getAttribute("AdminUser")==null || session.getAttribute("AdminUser").toString()==""){
                                response.sendRedirect("/Admin/adminlogin.jsp");
                           }
                        %>
                        <table>
                            <tr>
                                <td><h3>Payment Information </h3></td>
                                <td><h3>User Infomation</h3></td>
                                <td><h3>Event Infomation</h3></td>
                            </tr>
                            <%
                            Connection conn=null;
                            PreparedStatement ps=null;
                            ResultSet rs=null;
                            String sql="SELECT  PaymentLecture.ID, PaymentLecture.[User], PaymentLecture.EventID, PaymentLecture.GroupPaymentID, PaymentLecture.StatusPayment, PaymentLecture.Status, ";
                             sql+="PaymentLecture.Description, LectureEvent.EventName, LectureEvent.Start, LectureEvent.[End], LectureEvent.EventDay, LectureEvent.Location, ";
                             sql+="LectureEvent.PriceJoin, LectureEvent.CurrentJoin, LectureEvent.MaxJoin, Member.FullName, Member.Image, Member.Email, Member.DOB, Member.IDCard, ";
                             sql+="Member.MobilePhone, Member.HomePhone, Member.Address, GroupPayment.Style ";
                             sql+="FROM  PaymentLecture INNER JOIN ";
                             sql+="LectureEvent ON PaymentLecture.EventID = LectureEvent.EventID INNER JOIN ";
                             sql+="Member ON PaymentLecture.[User] = Member.UserName INNER JOIN ";
                             sql+="GroupPayment ON PaymentLecture.GroupPaymentID = GroupPayment.ID ";
                             sql+="WHERE  PaymentLecture.ID = ?";
                             try{
                                conn=MyConnect.getConnection();
                                ps=conn.prepareCall(sql);
                                ps.setInt(1,Integer.parseInt(request.getParameter("ID").toString()));
                                rs=ps.executeQuery();
                                while(rs.next()){
                                    %>
                                    <tr>
                                        <td>User register : <%out.print(rs.getString("User").toString());%></td>
                                        <td>Name of user : <%=rs.getString("FullName").toString()%></td>
                                        <td>Name of event lecture : <%=rs.getString("EventName").toString()%>
                                        <input type="hidden" name="txtEventID" value="<%=rs.getString("EventID").toString()%>"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Name : <%=rs.getString("EventName").toString()%></td>
                                        <td>Email : <%=rs.getString("Email").toString()%> </td>
                                        <td>Start : <%=rs.getString("Start").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td>Style payment : <%=rs.getString("Style").toString()%></td>
                                        <td>Birthday : <%=rs.getString("DOB").toString()%> </td>
                                        <td>End : <%=rs.getString("End").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td>Status : <span style="color: #0000FF">UnActive</span></td>
                                        <td>Identification : <%=rs.getString("IDCard").toString()%> </td>
                                        <td>Day of event : <%=rs.getString("EventDay").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>Mobile phone : <%=rs.getString("MobilePhone").toString()%> </td>
                                        <td>Location : <%=rs.getString("Location").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>Mobile Phone : <%=rs.getString("HomePhone").toString()%> </td>
                                        <td>Price : <%=rs.getString("PriceJoin").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td><input name="txtID" type="hidden" value="<%=request.getParameter("ID").toString()%>" /></td>
                                        <td>Address : <%=rs.getString("Address").toString()%> </td>
                                        <td>Current Join : <%=rs.getString("CurrentJoin").toString()%>
                                            <input type="hidden" name="txtCurrentJoin" value="<%=rs.getString("CurrentJoin").toString()%>"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td>Max Join :<%=rs.getString("MaxJoin").toString()%></td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><input type="submit" id="pagestatus" value="Active"/><input type="reset" value="Cancel" /> </td>
                                        <td></td>
                                    </tr>
                                    <%
                                }
                                conn.close();
                             }catch(Exception ex){
                                ex.getMessage();
                                conn.close();
                             }
                            %>
                        </table>
                    </form>
                </div>
                <!-- // #main -->
                <div class="clear"></div>
                </div>
            </div>
    </body>
</html>
